package org.sabayframework.cluster;


/**
 * Controls distribution of activities and data across the cluster.
 * TODO support failure handling.
 * */
public interface DistributionStrategy {
	
	/**
	 * Select a child node id for given node, activity and data.
	 * Assigns a particular data item to a node or an activity to a node 
	 * when data transfer is unimportant.
	 * @param node a node of a cluster which queue 
	 * @param activity distributed activity
	 * @param dataItem an object that can be used to select child node or null if
	 * selection should be based on activity.
	 * */
	NodeId select(Node node, DistributedActivity<?, ?> activity, Object dataItem);
}
